package model.building;

import model.City;
import model.Ressources;
import model.util.Vector3D;
import model.util.Object3D;
import model.util.Box3D;

public abstract class Housing extends Building {

    /** Constructeurs */
    public Housing(City city, Object3D object3d, Activity activity) { super(city, object3d, activity); }

    /** Classe internes */
    public static class Activity extends Building.Activity {

        /** Attributs */
        private double m_population; 

        /** Constructeurs */
        public Activity(double population) { m_population = population; }

        public Activity(Activity a) {
            m_population = a.m_population;
        }

        public double getPopulation() { return m_population; }

        /** Predicats */
        public boolean canConstruct(Ressources economy) { 
            return economy.getQuantity(Ressources.Type.PERSONS) + m_population <= economy.getLimit(Ressources.Type.PERSONS);
        }
        
        /** Methodes */
        public void construct(Ressources economy) {
            economy.add(Ressources.Type.PERSONS, m_population); 
        }
        
        public Ressources getImpact(double deltaTps, Ressources economy) { return new Ressources(); }

        public void destroy(Ressources economy) {
            economy.remove(Ressources.Type.PERSONS, m_population); 
        }
    }
}